import type { FindLimitDto, FindList } from "./auth";

export interface Smtp {
  id: number; // 标记为主列，值自动生成
  fromEmail: string;
  toEmail: string;
  subject: string;
  text: string;
  isSuccess: boolean; // 是否发送成功
  createTime: Date;
  updateTime: Date;
}
export interface findSmtp extends FindLimitDto {
  fromEmail?: string;
  toEmail?: string;
  isSuccess?: boolean; // 是否发送成功
}
export const findAll = (query?: findSmtp) => {
  return useServerRequest<FindList<Smtp>>("/smtp", {
    method: "GET",
    params: { ...query },
  });
};
export const delSmtp = (id: number) => {
  return useServerRequest(`/smtp/${id}`, {
    method: "DELETE",
    body: {},
  });
};
